package com.commerceE.dao.impl;

import java.util.List;

import com.commerceE.common.dao.GenericIBatisDaoImpl;
import com.commerceE.dao.ProductInstanceDao;
import com.commerceE.domain.Product_instance;

public class ProductInstanceDaoImpl extends GenericIBatisDaoImpl<Product_instance> implements ProductInstanceDao{

	@Override
	public String getNAMESPACE() {
		return Product_instance.class.getName();
	}
	
	public List<Product_instance> getProductInstanceByProductId(Long productId){
		return getSqlSession().selectList(getNAMESPACE() +".getProductInstanceByProductId",productId);
	}
	
	public Product_instance getProductInstanceByProductIdAndColorAndSize(Long productId, Long colorId,Long sizeId){
		Product_instance pi = new Product_instance();
		pi.setProductId(productId);
		pi.setColorId(colorId);
		pi.setSizeId(sizeId);
		return getSqlSession().selectOne(getNAMESPACE() +".getProductInstanceByProductIdAndColorAndSize",pi);
	}
}
